package org.pr.ddddesigner.infrastructure.config;

import com.lion.commons.constant.SymbolConstant;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.UUID;

/**
 * des something
 *
 * @author bufanqi
 * @date 2021-11-25 18:13
 **/
@Component
@ConfigurationProperties(prefix = "xw.api.file-manager")
@Setter
public class XwFileManagerApiProperties {
    @Getter
    private String url;
    private String apiPrefix;
    private String createFolder;
    private String getModelFileByFileId;
    private String findAttachProperty;
    private String findModelPackage;
    private String getModelFileLocationByFileId;

    public String getCreateFolder() {
        return url+apiPrefix+createFolder;

    }
    public String getFindAttachProperty() {
        return url+apiPrefix+findAttachProperty;

    }

    public String getFindModelPackage() {
        return url+apiPrefix+findModelPackage;
    }

    public String getGetModelFileByFileId(UUID fileId) {
        return url+apiPrefix+getModelFileByFileId+fileId;
    }

    public String getGetModelFileLocationByFileId(UUID fileId) {
        return url+apiPrefix+getModelFileLocationByFileId.replace(SymbolConstant.PLUS,fileId.toString());
    }
}
